package com.lj.uc.service.model;

import java.util.HashMap;

/**
 * Created by dave_suwei on 2017/12/25.
 */
public class MySession {
    private String sessionId;
    private HashMap<String,Object> attributeMap;
    private long createTime;
    private long updateTime;

    public String getSessionId() {
        return sessionId;
    }
    public void setSessionId(String sessionId) {
        this.sessionId = sessionId;
    }
    public HashMap<String, Object> getAttributeMap() {
        return attributeMap;
    }
    public void setAttributeMap(HashMap<String, Object> attributeMap) {
        this.attributeMap = attributeMap;
    }

    public long getCreateTime() {
        return createTime;
    }

    public long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(long updateTime) {
        this.updateTime = updateTime;
    }

    public MySession(String sessionId) {
        this.sessionId = sessionId;
        this.attributeMap=new HashMap<>();
        createTime= System.currentTimeMillis();
    }
    public void setAttribute(String key, Object obj){
        this.attributeMap.put(key,obj);
    }
    public Object getAttribute(String key){
        return this.attributeMap.get(key);
    }
}
